package org.example.pims.menu;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * 前端菜单结点
 *
 * @author bothin
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class MenuNode implements Serializable {
    private static final long serialVersionUID = 444814669324286760L;
    /**
     * 要跳转的路由名称 不是路径
     */
    private String name;
    /**
     * icon类型
     */
    private String type;
    /**
     * 文本内容
     */
    private String text;
    /**
     * 二级菜单
     */
    private List<MenuNode> children;

    public MenuNode(String name, String type, String text) {
        this.name = name;
        this.type = type;
        this.text = text;
        this.children = null;
    }

    public MenuNode(String name, String type, String text, List<MenuNode> children) {
        this.name = name;
        this.type = type;
        this.text = text;
        this.children = children;
    }
}
